﻿using KZ.Express.ENT;
using KZ.Express.Presenter;
using KZ.Express.Resource;
using KZ.Utilities;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace KZ.Express.Setup.KZSystem
{
    public partial class LoginAccountListView : FormBase
    {
        #region Private Variables

        bool _isVisible;

        #endregion

        #region Private Methods

        private void LoginAccountView_Load(object sender, EventArgs e)
        {
            base.LoadData();
        }

        private void LoginAccountListView_VisibleChanged(object sender, EventArgs e)
        {
            if (this.Visible && !_isVisible)
                base.LoadData();
            _isVisible = this.Visible;
        }

        #endregion Private Methods

        #region Constructors

        public LoginAccountListView()
        {
            InitializeComponent();
            base.ObjectID = (int)Objects.LoginAccount;

            base.OrderBy = "FullName";
            base.OrderDirection = "ASC";
            base.Action = ActionName.List;
            base.InitializeDataGrid(dtgUser);
            base._presenter = new PresenterBase(this, new UserENT());

            dtgUser.ColumnHeaderMouseClick += dtg_ColumnHeaderMouseClick;
        }

        #endregion Constructors

        #region Public Properties

        [Search]
        public int CurrentID 
        {
            get { return UserENT.USERID; }
        }

        #endregion Public Properties
    }
}
